Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

Fixes #8409 - Pull docker image asynchronously #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dLobatog
Copy link
Member

No description provided.

@@ -73,23 +69,19 @@ def provider_friendly_name
end

def create_container(args = {})
options = vm_instance_defaults.merge(args)
options = vm_instance_defaults.merge(args) { |_, default, new| new.empty? ? default : new }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was changed so that when no Cmd is specified, it uses the default. Otherwise a .merge will not replace a [] as it's not nil.

container
end

# destroy_wizard_state(wizard_state)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left this commented out while I was developing this feature - should NOT be commented normally

@dLobatog
Copy link
Member Author

Updated to let the action be a good thread citizen and not block the pool. To be tested with foreman core develop, I'll submit a patch with 1.7 compat fixes separately so we can keep track of these.

cc @witlessbird @daviddavis @parthaa can you test it?

rescue => e
action_logger.error(e.message)
action_logger.debug(e.backtrace.join("\n "))
error!(e)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a thread save call, changing the state of the action from a different thread. The error needs to be sent back to the action same as :done event.

@dLobatog
Copy link
Member Author

Updated with a test for the provision plan and commented out the tests for the run phase of start and pull. I'll work with @iNecas or @pitr-ch trying to figure out what I'm doing wrong so that these tests don't pass.

@domcleal
Copy link
Contributor

domcleal commented Feb 3, 2015

re the test failure, what appears to be happening is that foreman-tasks is registering its extensions to the test rake task from its engine.rb initialisers. foreman-docker is of course requiring foreman-tasks, but the 'test' task(s) are now extended with both foreman-docker's and foreman-tasks' tests.

I don't know whether we should be running foreman-tasks' tests from here or not. We run core tests from plugins to check a plugin didn't break a core behaviour, and you could argue whether that should be the case or not for a plugin building on another plugin. It might be harder, since plugin tests may require additional development dependencies.

If you do want to run foreman-tasks tests, then I think something's wrong with the load paths (here?).

If not, then some refactoring of how rake tasks are modified (e.g. so they only happen when testing the plugin itself) or how we choose which sets are run is needed.. I need to think a bit more about that I guess.

if started
container.update_attribute(:uuid, started.id)
else
errors << container.compute_resource.errors[:base]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is lacking a test - and errors is not defined

@iNecas
Copy link
Member

iNecas commented Mar 13, 2015

This PR should address the issue with the foremant-tasks tests (so that the tasks tests should not be run as part of this engine tests) theforeman/foreman-tasks#103

@dLobatog
Copy link
Member Author

@iNecas Awesome! Any prospective dates for a release?

@iNecas
Copy link
Member

iNecas commented Mar 16, 2015

Hopefully today, we have other feature that I would like to get in before the release, but if we don't get that done till tomorrow, i will release new version without it anyway.

@iNecas
Copy link
Member

iNecas commented Mar 17, 2015

The new versions in a PR for foreman-packaging theforeman/foreman-packaging#582

@iNecas
Copy link
Member

iNecas commented Mar 17, 2015

[test]

@dLobatog
Copy link
Member Author

[test]

@dLobatog
Copy link
Member Author

[test] this got aborted I think

@dLobatog dLobatog force-pushed the 8409 branch 2 times, most recently from efe3a69 to 907e59d Compare April 7, 2015 11:33
@dLobatog
Copy link
Member Author

dLobatog commented Apr 8, 2015

[test] - tests were failing because I was using minitest-reporters here (and it's not used in Foreman core)

@dLobatog
Copy link
Member Author

dLobatog commented Apr 8, 2015

@daviddavis @parthaa @witlessbird Could you give a last test at this before merging?

@dmitri-d
Copy link
Member

dmitri-d commented Apr 9, 2015

looks good to me.

@dLobatog
Copy link
Member Author

I've been testing this a bit more thoroughly myself and I think this should:

  • Show a link to the task created when creating a container, telling the user to check Monitor > Tasks is not very user friendly.
  • If the task fails, show in the show container page that the task in question failed

I'll polish it up with these changes & resubmit when I get a chance.

@daviddavis
Copy link

@dLobatog any updates?

@dLobatog
Copy link
Member Author

dLobatog commented Mar 9, 2017

I'll pick this up again when ActiveJob is available

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants